<template>
  <div class="btn_all">
    <div class="left">
      <el-button type="primary" icon="iconfont icon-yunshangchuan_o">
        上传</el-button
      >
      <el-button type="default" icon="iconfont icon-xiazai"> 下载</el-button>
      <el-button type="default" icon="iconfont icon-sucai"> 移动</el-button>
      <el-button type="default" icon="iconfont icon-bianji"> 重命名</el-button>
      <el-button type="default" icon="iconfont icon-bianji"> 备注</el-button>
      <el-button type="default" icon="iconfont icon-fuzhi"> 复制</el-button>
      <el-button type="default" icon="iconfont icon-shanchu"> 删除</el-button>
    </div>
    <div class="right">
      <el-button type="primary" icon="el-icon-plus">新建文件夹</el-button>
      <el-button
        :type="activeIdx == 0 ? 'primary' : 'default'"
        icon="el-icon-s-grid"
        @click="showActive(0)"
      ></el-button>
      <el-button
        :type="activeIdx == 1 ? 'primary' : 'default'"
        icon="el-icon-menu"
        @click="showActive(1)"
      ></el-button>
      <el-select
        style="margin-left: 10px"
        v-model="selectVal"
        placeholder="文件类型"
      >
        <el-option
          v-for="item in selectList"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIdx: 0,
      selectVal: '',
      selectList: [
        { label: '全部', value: 0 },
        { label: '文档', value: 1 },
        { label: '视频', value: 2 },
        { label: '音频', value: 3 },
        { label: '图片', value: 4 },
        { label: '压缩包', value: 5 },
        { label: '其他', value: 6 },
      ],
    }
  },
  methods: {
    showActive(curIdx) {
      this.activeIdx = curIdx
      this.$emit('show_active', this.curIdx)
    },
  },
}
</script>

<style lang="scss" scoped>
.btn_all {
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
</style>